package com.yj.controller;

import com.yj.entity.Classes;
import com.yj.service.ClassesService;
import com.yj.util.R;
import jdk.nashorn.internal.objects.annotations.Getter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 类名：
 * 作者：WF
 * 功能：
 */
@RestController
@RequestMapping("/classes")
public class ClassesController {
	@Autowired
	private ClassesService classesService;

	/**
	 * 1. 查询班级列表
	 */
	@GetMapping("/list")
	public R<List<Classes>> list(){
		List<Classes> classes = classesService.findAll();
		return R.ok(classes);
	}
}
